package main

import (
	"fmt"
	"operator/pkg/network/meshnet/tcp"
	"os"
)

func main() {
	ch := make(chan string)
	go func() {
		for {
			var ip string
			_, err := fmt.Scanln(&ip)
			if err != nil {
				return
			}
			ch <- ip
		}
	}()
	ts, err := tcp.NewServer(5555, ch)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	stop := make(chan struct{})

	ts.Run(stop)
	select {}
}
